package com.kerrykidz.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kerrykidz.parreserve.dao.mapper.ParRoomEntityMapper;
import com.kerrykidz.parreserve.dao.model.ParRoomEntity;
import com.kerrykidz.system.service.IParRoomService;
import com.rdp.framework.exception.RDPException;

@Service
public class ParRoomServiceImpl implements IParRoomService {
	@Autowired
	private ParRoomEntityMapper roomEntityMapper;
	
	/**
	 * 查询房间Detail
	 * @return 
	 * @throws RDPException
	 * @date: 2014年8月22日
	 */
	@Override
	public ParRoomEntity findRoomdetail(ParRoomEntity entity) throws RDPException {
		entity.setIspaging(true);
		List<ParRoomEntity> beanList = roomEntityMapper.findRoomDetail(entity);
		if(beanList.size()>0){
			entity.setResults(beanList);
		}
		return entity;
	}

	/**
	 * 删除房间
	 * @return 
	 * @throws RDPException
	 * @date: 2014年8月22日
	 */
	
	@Override
	public void deleteRoomById(ParRoomEntity entity) throws RDPException {
		
		roomEntityMapper.deleteRoomById(entity);
		
	}
	
	/**
	 * 添加房间
	 * @return 
	 * @throws RDPException
	 * @date: 2014年8月26日
	 */
	@Override
	public void addRoom(ParRoomEntity roomEntity) throws RDPException {
		
		roomEntityMapper.addRoom(roomEntity);
	}
	
	/**
	 * 修改房间
	 * @return 
	 * @throws RDPException
	 * @date: 2014年8月26日
	 */
	@Override
	public void updateRoom(ParRoomEntity roomEntity) throws RDPException {
		
		roomEntityMapper.updateRoom(roomEntity);
		
	}

}
